package com.yanjingzheng.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author Yenchingcheng
 * @Date 2023/10/27 11:06
 * @Description 命令调用类
 **/
public class Broker {

    private List<Order> orderList = new ArrayList<>();

    public void takeOrder(Order order){
        orderList.add(order);
    }

    public void placeOrders(){
        for (Order order :orderList) {
            order.execute();
        }
        orderList.clear();
    }
}
